package net.skyaims.sqlmgr.dao;

import java.util.List;

import net.skyaims.sqlmgr.domain.NodeTable;

import org.skife.jdbi.v2.sqlobject.Bind;
import org.skife.jdbi.v2.sqlobject.SqlQuery;
import org.skife.jdbi.v2.sqlobject.SqlUpdate;
import org.skife.jdbi.v2.sqlobject.customizers.Mapper;

public interface NodeDao {

	@SqlQuery("SELECT * FROM node_tbl n WHERE n.nid = :nid")
	@Mapper(NodeTable.class)
	NodeTable getIdcById(@Bind("nid") Integer nid);

	@SqlQuery("SELECT * FROM node_tbl n WHERE n.nid < 100")
	@Mapper(NodeTable.class)
	List<NodeTable> getAll();

	@SqlUpdate("UPDATE node_tbl n SET n.uuid = :uuid WHERE n.nid = :nid")
	void updateUuidById(@Bind("nid") int id, @Bind("uuid") String uuid);

}
